<?php

defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$return['list']=array();
	$return['params']=array('type'=>intval($_RQ['type'])?:100);
	exi($return);
}
if($_RQ['op']=='getlist'){
	$return['params']=array();
	$params=array('merchid'=>$_SESSION['onemerchid'],'uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']);
	if(intval($_RQ['type'])!=100){
		$params['type']=intval($_RQ['type']);
	}
	//我的团
	//先查询我的订单
	$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	$list=pdo_getslice('jy_mjicai_feelog',$params,array($pindex,$psize),$total,$fields,'','createtime desc');
	if($list){
		foreach($list as $k=>&$item){
			$item['createtime']=date('Y-m-d H:i:s',$item['createtime']);
			$item['typetitle']=$this->feelog_type[$item['type']];
			$item['paixu']=pdo_getcolumn('jy_mjicai_yao',array('id'=>$item['yaoid'],'uniacid'=>$_SESSION['uniacid']),'paixu');
			$get_cangtitle=$this->model('model')->get_cangtitle($item['cangid']);
			$item['title']=$get_cangtitle;
			if($item['paixu']){
				$item['title'] .='第【'.$item['paixu'].'】'.$this->y_title;
			}
		}
	}
	$return['list']=$list;
	exi($return);
}